<?php

namespace app\common\model;

use think\Model;

class Admin extends Model
{
    //自动生成写入时间
    protected $autoWriteTimestamp = true;

    /**
     * 获取某个管理员信息
     * @param $username
     * @return User|array|mixed|Model|null
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     */
    public function getAdmin($data)
    {
        return $this->where($data)->withoutField('password')->find();
    }

}